#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;

class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int size = nums.size();
        int sumSize = size+0.5*size*(size-1);
        int sum =0;
        for(int i = 0;i<nums.size();++i){
            sum +=nums[i];
        }
        return sumSize-sum;
    }
};

int main(){
    Solution S;
    vector<int> V = {0};
    cout<<S.missingNumber(V)<<endl;
}